//
// Created by admin on 2023/1/30.
//

#ifndef BV_ERROR_H
#define BV_ERROR_H

#include <exception>
#include <string>

namespace utils {

class Error : public std::exception {

public:
    virtual void print() const {};
};

class IoError : public Error {
public:
    IoError();
    IoError(int err);

    const char * what() const noexcept override;

    void print() const noexcept override;

private:
    const char *m_err_msg;
};

class IllegalError : public Error {

public:
    IllegalError(const char *msg);

    const char *what() const noexcept override;

    void print() const noexcept override;

private:
    const char *m_err_msg;
};

const char *current_err_msg();

}

#endif //BV_ERROR_H
